home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / QuickDraw™ GX v1.0ß2 / Sample Code / Printing Samples / Printer Drivers… / LaserWriterIISC / UniversalMessageResources.r < prev    next >
Encoding:
Text File  |  1993-09-13  |  15.9 KB  |  462 lines  |  [TEXT/MPS ]

  1. /* ------------------------------------------------------------------------------
  2. FILENAME
  3.     NewAPIResources.r
  4.  
  5. DESCRIPTION
  6.     This module contains the LaserWriter SC constants, types, and resources that
  7.     are specific to supporting the New (QuickDraw GX) API.
  8.             
  9.     Note: all resources should be designated to load into the system heap.
  10.  
  11.     9/13/93 - dmh - Updated for the b2 seed.
  12.  
  13. COPYRIGHT
  14.      Copyright Apple Computer, Inc. 1988-1992
  15.      All rights reserved. 
  16.     
  17. -------------------------------------------------------------------------------- */
  18.  
  19. // System 7.0 Compatible
  20. #define SystemSevenOrLater        1
  21.  
  22. // Include System Resource Definitions
  23. #include "Types.r"
  24. #include "SysTypes.r"
  25.  
  26. // Include the LaserWriter SC driver constants that are used in the resources 
  27. #include "Resources.h"
  28.  
  29. // Include the public QuickDraw GX printing files 
  30. #include "PrintingResTypes.r"
  31.  
  32.  
  33. /*********************************************************************************
  34.  *                                RESOURCES                                                              *
  35.  *********************************************************************************/
  36.  
  37. /*************************** Universal Imaging Message Override Resource **************************/
  38. // This overrideType resource tells the Printing Manager which new Universal Imaging 
  39. // Messages the driver overrides. 
  40.  
  41. resource gxOverrideType (gxDriverUniversalOverrideID, sysheap, purgeable)
  42. {
  43.     {
  44.         gxInitialize,        kNewAPISegmentID, kFirstMsgJumpTableOffset,
  45.         gxShutDown,         kNewAPISegmentID, kFirstMsgJumpTableOffset +  4,
  46.         gxDespoolPage,         kNewAPISegmentID, kFirstMsgJumpTableOffset +  8,
  47.         gxSetUpImageData,     kNewAPISegmentID, kFirstMsgJumpTableOffset + 12,
  48.         gxOpenConnection,     kNewAPISegmentID, kFirstMsgJumpTableOffset + 16,
  49.         gxCloseConnection,    kNewAPISegmentID, kFirstMsgJumpTableOffset + 20,
  50.         gxStartSendPage,     kNewAPISegmentID, kFirstMsgJumpTableOffset + 24,
  51.         gxFinishSendPage,     kNewAPISegmentID, kFirstMsgJumpTableOffset + 28,
  52.         gxDefaultPrinter,     kNewAPISegmentID, kFirstMsgJumpTableOffset + 32,
  53.         gxWriteData,         kNewAPISegmentID, kFirstMsgJumpTableOffset + 36,
  54.         gxCheckStatus,        kNewAPISegmentID, kFirstMsgJumpTableOffset + 40,
  55.         gxGetDeviceStatus,    kNewAPISegmentID, kFirstMsgJumpTableOffset + 44,
  56.         gxCreateImageFile,    kNewAPISegmentID, kFirstMsgJumpTableOffset + 48,
  57.         gxFetchTaggedData,    kNewAPISegmentID, kFirstMsgJumpTableOffset + 52,
  58.         gxDoesPaperFit,        kNewAPISegmentID, kFirstMsgJumpTableOffset + 60,
  59.     };
  60. };
  61.  
  62.  
  63. /*************************** Raster Imaging Message Override Resource **************************/
  64. // This overrideType resource tells the Printing Manager which Raster Imaging Messages the driver 
  65. // overrides. 
  66.  
  67. resource gxOverrideType (gxDriverImagingOverrideID, sysheap, purgeable)
  68. {
  69.     {
  70.         gxRasterDataIn,     kNewAPISegmentID, kFirstMsgJumpTableOffset + 56,
  71.     };
  72. };
  73.  
  74.  
  75. /*************************** Type of Imaging System Supported by the Driver **************************/
  76. // This imagingSystemResType resource tells the Printing Manager the type of imaging system this 
  77. // driver uses.
  78.  
  79. resource gxImagingSystemSelectorType (gxImagingSystemSelectorID, sysheap, purgeable)
  80. {
  81.     gxRasterPrinterType        // LaserWriter SC uses the raster imaging system 
  82. };
  83.  
  84.  
  85. /*************************** Customizing Behavior of Raster Imaging Messages ***************************/
  86. // For most raster devices, the driver should include a resource of type, rasterPrefsType.  This 
  87. // resource allows the driver to specify the imaging options and format page scaling.  Since 
  88. // the Printing Manager default rasterPrefsType resource is defined for a 1 bit, 300 dpi device, 
  89. // the LaserWriter SC driver uses this default. 
  90.  
  91.  
  92. /*************************** I/O Related Resources ***************************/
  93.  
  94. // This universalIOPrefsType resource controls the behavior of the standard buffering and IO 
  95. // within the Universal Driver. 
  96.  
  97. resource gxUniversalIOPrefsType (gxUniversalIOPrefsID, sysheap, purgeable)
  98. {
  99.         standardIO,
  100.         0,                // Universal Driver will not allocate any buffers 
  101.         0,                // size of the buffers allocated (N/A) 
  102.         10,            // number of I/O request blocks to allocate for the Universal Driver's I/O 
  103.         1200,            // 1200 tick timeout for open/close 
  104.         1200,            // 1200 tick timeout for reading and writing 
  105. };
  106.     
  107.  
  108. /*************************** Status Dialog Related Resources ***************************/
  109. // The 'stat' resources provide the Printing Manager the status messages that need to be displayed at
  110. // any given time during the printing process. The driver forces statuses to be displayed by calling 
  111. // either ReportStatus or AlertTheUser, depending upon whether the user needs to make some decision 
  112. // about the printing process (e.g. paper tray not properly loaded. Note that though the statID field
  113. // of the 'stat' resource is for the clients use (us), PrinterShare requires that any 'stat' list
  114. // entry that has the same status type (e.g. informationalStatus) must have a unique statID.  The reason
  115. // is that PrinterShare uses the (status type, statID) pair in comparisons to see if the status has
  116. // changed.
  117.  
  118. resource 'stat' (kTransmissionStatID, sysheap, purgeable)         // Page transmission 'stat' - informational messages only 
  119. {
  120.     kDrvrCreatorType,
  121.     {
  122.         informationalStatus,     1,        kNoAlertCoolID,         "Waiting for the next sheet of paper…";
  123.         informationalStatus,    2,        kNoAlertCoolID,            "Sending part of the page…";
  124.         informationalStatus,    3,        kNoAlertCoolID,            "Preparing part of the page…";
  125.         informationalStatus,     4,        kNoAlertCoolID,         "The printer is out of paper.";
  126.         informationalStatus,     5,        kNoAlertCoolID,         "The printer has a paper jam.";
  127.         informationalStatus,     6,        kNoAlertCoolID,            "The paper tray is improperly loaded.";
  128.         userAlert,                 7,     kPrinterDoorOpenCoolID,        "The printer door is open.  Please close it.";
  129.         informationalStatus,     8,     kNoAlertCoolID,                "The printer door is open.  Please close it.";    //    Non-alert instance of the status
  130.         informationalStatus,     9,     kNoAlertCoolID,                "A print test is in progress.  Please wait…";
  131.         informationalStatus,     10,    kNoAlertCoolID,                "The printer fixing unit is being heated.  Please wait…";
  132.         userAlert,                11,    kBadTonerCartridgeCoolID,    "The toner cartridge is improperly loaded.";
  133.         informationalStatus,    12,    kNoAlertCoolID,                "The toner cartridge is improperly loaded.";        //    Non-alert instance of the status
  134.         informationalStatus,     13,    kNoAlertCoolID,                "Printing the page.";
  135.         userAlert,                     14,    kCantFindPrinterCoolID,    "Trying to locate the printer…";
  136.         openConnectionStatus,     15,    kNoAlertCoolID,                "Opening a connection to the printer…";
  137.     }
  138. };
  139.  
  140. resource 'stat' (kEngineStatusStatID, sysheap, purgeable)        // Printer engine status 'stat' - fatal errors 
  141. {
  142.     kDrvrCreatorType,
  143.     {
  144.         userAlert,            1,    kLaserInitFailureCoolID,    "Laser Printer engine initialization failed.";
  145.         userAlert,            2,    kDRamFailureCoolID,            "Dynamic Ram test failure.";
  146.         userAlert,             3,    kBadPrintFixCoolID,         "The printer fixing assembly has malfunctioned.";
  147.         userAlert,             4,    kBadLaserCoolID,             "The printer laser has malfunctioned.";
  148.         userAlert,             5,    kBadPolyMotorCoolID,         "The printer polygon motor has malfunctioned.";
  149.         userAlert,             6,    kBadSerialCoolID,             "The printer has a serial communication malfunction.";
  150.         userAlert,             7,    kGenericBadHdwareCoolID,     "The printer has a hardware malfunction.";
  151.     }
  152. };
  153.  
  154.  
  155.  
  156. // Following are the 'cool' alert definitions which are used to notify the user of FATAL printing errors. 
  157.  
  158. resource 'cool' (kLaserInitFailureCoolID, sysheap, purgeable)        // Laser Printer initialization failed 
  159. {
  160.     coolStatus,                                                    // version 
  161.     stopIcon,                                                    // icon id 
  162.     defaultSystemSize,
  163.     defaultAction,                                                // the default label 
  164.     noCancelTitle,                                                // haven't got a cancel 
  165.     "The document !1 failed to print, because the printer !0 failed to initialize.",            // text string 
  166.     "Cancel Printing",                                        // action label 
  167.     "",                                                            // button label 2 
  168.     "",                                                            // button label 3 
  169.     " ",                                                            // font name 
  170.     "Printer Failure"
  171. };
  172.  
  173.  
  174. resource 'cool' (kDRamFailureCoolID, sysheap, purgeable)        // Dynamic Ram test failure 
  175. {
  176.     coolStatus,                                                    // version 
  177.     stopIcon,                                                    // icon id 
  178.     defaultSystemSize,
  179.     defaultAction,                                                // the default label 
  180.     noCancelTitle,                                                // haven't got a cancel 
  181.     "The document !1 failed to print, because the printer !0 experienced a dynamic RAM failure.",    // text string 
  182.     "Cancel Printing",                                        // action label 
  183.     "",                                                            // button label 2 
  184.     "",                                                            // button label 3 
  185.     " ",                                                            // font name 
  186.     "Printer Failure"
  187. };
  188.  
  189.  
  190. resource 'cool' (kBadPrintFixCoolID, sysheap, purgeable)         // printer fixing assembly bad 
  191. {
  192.     coolStatus,                                                    // version 
  193.     stopIcon,                                                    // icon id 
  194.     defaultSystemSize,
  195.     defaultAction,                                                // the default label 
  196.     noCancelTitle,                                                // haven't got a cancel 
  197.     "The document !1 failed to print, because the fixing assembly in the printer !0 has malfunctioned.",  // text string 
  198.     "Cancel Printing",                                        // action label 
  199.     "",                                                            // button label 2 
  200.     "",                                                            // button label 3 
  201.     " ",                                                            // font name 
  202.     "Printer Failure"
  203. };
  204.  
  205. resource 'cool' (kBadLaserCoolID, sysheap, purgeable)         // laser bad 
  206. {
  207.     coolStatus,                                                    // version 
  208.     stopIcon,                                                    // icon id 
  209.     defaultSystemSize,
  210.     defaultAction,                                                // the default label 
  211.     noCancelTitle,                                                // haven't got a cancel 
  212.     "The document !1 failed to print, because the laser in the printer !0 has malfunctioned.",    // text string 
  213.     "Cancel Printing",                                        // action label 
  214.     "",                                                            // button label 2 
  215.     "",                                                            // button label 3 
  216.     " ",                                                            // font name 
  217.     "Printer Failure"
  218. };
  219.  
  220. resource 'cool' (kBadPolyMotorCoolID, sysheap, purgeable)         // polygon motor bad 
  221. {
  222.     coolStatus,                                                    // version 
  223.     stopIcon,                                                    // icon id 
  224.     defaultSystemSize,
  225.     defaultAction,                                                // the default label 
  226.     noCancelTitle,                                                // haven't got a cancel 
  227.     "The document !1 failed to print, because the polygon motor in the printer !0 has malfunctioned.",    // text string 
  228.     "Cancel Printing",                                        // action label 
  229.     "",                                                            // button label 2 
  230.     "",                                                            // button label 3 
  231.     " ",                                                            // font name 
  232.     "Printer Failure"
  233. };
  234.  
  235. resource 'cool' (kBadSerialCoolID, sysheap, purgeable)         // serial communication bad 
  236. {
  237.     coolStatus,                                                    // version 
  238.     stopIcon,                                                    // icon id 
  239.     defaultSystemSize,
  240.     defaultAction,                                                // the default label 
  241.     noCancelTitle,                                                // haven't got a cancel 
  242.     "The document !1 failed to print, because a serial communication malfunction has occurred in the printer !0.",    // text string 
  243.     "Cancel Printing",                                        // action label 
  244.     "",                                                            // button label 2 
  245.     "",                                                            // button label 3 
  246.     " ",                                                            // font name 
  247.     "Printer Failure"
  248. };
  249.  
  250. resource 'cool' (kGenericBadHdwareCoolID, sysheap, purgeable)         // unidentified hardware malfunction 
  251. {
  252.     coolStatus,                                                    // version 
  253.     stopIcon,                                                    // icon id 
  254.     defaultSystemSize,
  255.     defaultAction,                                                // the default label 
  256.     noCancelTitle,                                                // haven't got a cancel 
  257.     "The document !1 failed to print, because the printer !0 experienced an unknown hardware malfunction.",    // text string 
  258.     "Cancel Printing",                                        // action label 
  259.     "",                                                            // button label 2 
  260.     "",                                                            // button label 3 
  261.     " ",                                                            // font name 
  262.     "Printer Failure"
  263. };
  264.  
  265. // Following are the 'cool' alert definitions which are used to notify the user of NON-FATAL printing errors. 
  266.  
  267. resource 'cool' (kPrinterDoorOpenCoolID, sysheap, purgeable)            //    The printer's door is open so we can't print
  268. {
  269.     coolStatus,                                                                // version
  270.     cautionIcon,                                                            // icon id
  271.     defaultSystemSize,
  272.     defaultAction,                                                            // the default label
  273.     cancelTitle2,                                                            // second button is cancel
  274.      "The printer door on the printer !0 is open.  To "        // text string
  275.      "continue printing !1, please close the door and "        // text string
  276.      "click Continue.  If you wish to cancel printing, "       // text string
  277.      "please click Cancel Printing.",                                   // text string
  278.      "Continue",                                                                // action label
  279.     "Cancel Printing",                                                    // button label 2
  280.     "",                                                                        // button label 3
  281.     " ",                                                            // font name 
  282.     "Printer Failure"
  283. };
  284.  
  285. resource 'cool' (kBadTonerCartridgeCoolID, sysheap, purgeable)        //    The printer's toner cartridge is not inserted properly
  286. {
  287.     coolStatus,                                                                // version
  288.     cautionIcon,                                                            // icon id
  289.     defaultSystemSize,
  290.     defaultAction,                                                            // the default label
  291.     cancelTitle2,                                                            // second button is cancel
  292.      "The toner cartridge in the printer !0 is improperly "    //
  293.     "loaded.  To continue printing !1, please re-install "    //
  294.     "the cartridge properly and click Continue.  "
  295.      "If you wish to cancel printing, "                               // text string
  296.      "please click Cancel Printing.",                                   // text string
  297.      "Continue",                                                                // action label
  298.     "Cancel Printing",                                                    // button label 2
  299.     "",                                                                        // button label 3
  300.     " ",                                                                        // font name 
  301.     "Printer Failure"
  302. };
  303.  
  304. resource 'cool' (kCantFindPrinterCoolID, sysheap, purgeable)            //    The printer can't be found on the SCSI bus
  305. {
  306.     coolStatus,                                                                // version
  307.     cautionIcon,                                                            // icon id
  308.     defaultSystemSize,
  309.     defaultAction,                                                            // the default label
  310.     noCancelTitle,                                                            // no cancel
  311.     "The document !1 cannot be printed, because the printer "
  312.      "!0 cannot be found.  To continue printing, please make "
  313.     "sure the printer is "
  314.     "properly connected and turned on.  If you wish "    
  315.     "to cancel printing, please click Cancel Printing.",
  316.      "Cancel Printing",                                                    // action label
  317.     "",                                                                        // button label 2
  318.     "",                                                                        // button label 3
  319.     " ",                                                                        // font name 
  320.     "Printer Not Found"
  321. };
  322.  
  323.  
  324. /*************************** Paper Type Definitions for the New Printing Architecture **************************/
  325. // These paper type definitions represent the new settings for the LaserWriter SC's paper 
  326. // sizes. 
  327.  
  328. resource 'ptyp' (kNewPaperTypesID + 1, sysheap, purgeable)            // US Letter 
  329. {
  330.     "US Letter",
  331.     
  332.     // page rectangle 
  333.     0x00000000,                // 8.0 x 10.583
  334.     0x00000000,                
  335.     0x02400000,                
  336.     0x02F9F9B8,                
  337.  
  338.     // paper rectangle 
  339.     0xFFEE0000,                // 8.5 x 11.0
  340.     0xFFF0FCDC,                
  341.     0x02520000,                
  342.     0x0308FCDC,                
  343.     
  344.     usLetterBase,
  345.     kDrvrCreatorType,
  346.  
  347.     inch,
  348.     newStylePaperType,
  349.     notFixedPrintArea,
  350.     isDefaultPaperType,
  351.     defaultBasePT,
  352.     {}
  353. };
  354.  
  355. resource 'ptyp' (kNewPaperTypesID + 2, sysheap, purgeable)            // US Legal 
  356. {
  357.     "US Legal",
  358.     
  359.     // page rectangle 
  360.     0x00000000,                // 6.67 x 12.5
  361.     0x00000000,                
  362.     0x01E03D68,                    
  363.     0x03840000,                
  364.  
  365.     // paper rectangle 
  366.     0xFFBE1EB4,                // 8.5 x 14.0
  367.     0xFFCA0000,                
  368.     0x02221EB4,                
  369.     0x03BA0000,                
  370.     
  371.     usLegalBase,
  372.     kDrvrCreatorType,
  373.  
  374.     inch,
  375.     newStylePaperType,
  376.     notFixedPrintArea,
  377.     notDefaultPaperType,
  378.     defaultBasePT,
  379.     {}
  380. };
  381.  
  382. resource 'ptyp' (kNewPaperTypesID + 3, sysheap, purgeable)            // A4 Letter 
  383. {
  384.     "A4 Letter",
  385.     
  386.     // page rectangle 
  387.     0x00000000,                // 8.0 x 11.25 
  388.     0x00000000,
  389.     0x02400000,
  390.     0x032A0000,
  391.  
  392.     // paper rectangle 
  393.     0xFFF70000,                //    8.25 x 11.6667
  394.     0xFFF0FFAC,
  395.     0x02490000,
  396.     0x03390054,
  397.     
  398.     a4LetterBase,
  399.     kDrvrCreatorType,
  400.  
  401.     inch,
  402.     newStylePaperType,
  403.     notFixedPrintArea,
  404.     notDefaultPaperType,
  405.     defaultBasePT,
  406.     {}
  407. };
  408.  
  409. resource 'ptyp' (kNewPaperTypesID + 4, sysheap, purgeable)            // B5 Letter 
  410. {
  411.     "B5 Letter",
  412.     
  413.     // page rectangle 
  414.     0x00000000,                // 6.6667 x 9.4167 
  415.     0x00000000,                
  416.     0x01E000A8,                
  417.     0x02A600A8,                
  418.  
  419.     // paper rectangle 
  420.     0xFFF67FE4,                // 6.9306 x 9.8333
  421.     0xFFF100A8,                
  422.     0x01E980C4,                
  423.     0x02B50000,                
  424.     
  425.     b5LetterBase,
  426.     kDrvrCreatorType,
  427.  
  428.     inch,
  429.     newStylePaperType,
  430.     notFixedPrintArea,
  431.     notDefaultPaperType,
  432.     defaultBasePT,
  433.     {}
  434. };
  435.  
  436. resource 'ptyp' (kNewPaperTypesID + 5, sysheap, purgeable)            // Nº 10 Envelope 
  437. {
  438.     "Nº 10 Envelope",
  439.     
  440.     // page rectangle 
  441.     0x00000000,                    // 9.083 x 3.78 
  442.     0x00000000,                    
  443.     0x011028F0,                    
  444.     0x028DF9B8,                    
  445.     
  446.     // paper rectangle 
  447.     0xFFF39478,                    // 9.5 x 4.125 
  448.     0xFFF0FCDC,                    
  449.     0x011C9478,                    
  450.     0x029CFCDC,                    
  451.     
  452.     unknownBase,
  453.     kDrvrCreatorType,
  454.  
  455.     inch,
  456.     newStylePaperType,
  457.     notFixedPrintArea,
  458.     notDefaultPaperType,
  459.     notDefaultBasePT,
  460.     {}
  461. };
  462.